package com.party.core.model.mall;

import com.party.core.model.BaseModel;

import java.math.BigDecimal;

public class MallDataCount extends BaseModel {

    private static final long serialVersionUID = -7297991688029581305L;

    // 机构编号
    private String memberId;
    // 订单量
    private Integer orderNum;
    // 成交额
    private BigDecimal turnover;
    // 收益
    private BigDecimal income;
    // 商品销量
    private Integer salesNum;

    public MallDataCount() {
        orderNum = 0;
        turnover = new BigDecimal(0);
        income = new BigDecimal(0);
        salesNum = 0;
    }

    public String getMemberId() {
        return memberId;
    }

    public void setMemberId(String memberId) {
        this.memberId = memberId;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public BigDecimal getTurnover() {
        return turnover;
    }

    public void setTurnover(BigDecimal turnover) {
        this.turnover = turnover;
    }

    public BigDecimal getIncome() {
        return income;
    }

    public void setIncome(BigDecimal income) {
        this.income = income;
    }

    public Integer getSalesNum() {
        return salesNum;
    }

    public void setSalesNum(Integer salesNum) {
        this.salesNum = salesNum;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof MallDataCount)) return false;
        if (!super.equals(o)) return false;

        MallDataCount that = (MallDataCount) o;

        if (memberId != null ? !memberId.equals(that.memberId) : that.memberId != null) return false;
        if (orderNum != null ? !orderNum.equals(that.orderNum) : that.orderNum != null) return false;
        if (turnover != null ? !turnover.equals(that.turnover) : that.turnover != null) return false;
        if (income != null ? !income.equals(that.income) : that.income != null) return false;
        return salesNum != null ? salesNum.equals(that.salesNum) : that.salesNum == null;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (memberId != null ? memberId.hashCode() : 0);
        result = 31 * result + (orderNum != null ? orderNum.hashCode() : 0);
        result = 31 * result + (turnover != null ? turnover.hashCode() : 0);
        result = 31 * result + (income != null ? income.hashCode() : 0);
        result = 31 * result + (salesNum != null ? salesNum.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "MallDataCount{" +
                "memberId='" + memberId + '\'' +
                ", orderNum=" + orderNum +
                ", turnover=" + turnover +
                ", income=" + income +
                ", salesNum=" + salesNum +
                '}';
    }
}
